//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#include <elastos.h>
#include <libpub.h>
#include <bo_cmds.h>

unsigned long GetTicks(void)
{
    SystemTime t;
    _CSystem_GetMachineTime(&t);
    return ((t.seconds * 1000 + t.microseconds / 1000) % 64000) * 3250;
}

int Do_InitConfig(void)
{
    //TODO: Add your code here
    TOUT(1, 1, printf("Init Config\n"));
    return -1;
}

int Do_InitMemory(void)
{
    //TODO: Add your code here
    TOUT(1, 1, printf("Init Memory\n"));
    return 0;
}

int Do_InitSerial(void)
{
    //TODO: Add your code here
    TOUT(1, 1, printf("Init Serial\n"));
    return 0;
}

//==========================================================================
int Do_CheckKeyHold(void)
{
    //TODO: Add your code here
    TOUT(1, 1, printf("Get Key\n"));
    return VK_DOWNLOAD;
}

int Do_Quit(char *param)
{
    TOUT(0, 1, printf("do quit [%s]\n", param));
    unsigned long id = 0x100;
    if (*param) {
        Bo_ParseInteger(param, &id);
        printf("ID=%x\n", id);
    }
    return id;
}

int Do_DownLoad(char *param)
{
    TOUT(1, 1, printf("DownLoad [%s]\n", param));
    return 0;
}

int Do_Burn(char *param)
{
    TOUT(1, 1, printf("burn image [%s]\n", param));
    if (*param) {
        if (0 == Bo_MatchString(param, "CONFIRM")) {
            printf("Burn Success\n");
            return 0;
        }
    }
    printf("Access denied!\n");
    return -1;
}

int Do_Load(char *param)
{
    //TODO: Add your code here
    TOUT(1, 1, printf("load image [%s]\n", param));
    return 0;
}

int Do_Jump(char *param)
{
    //TODO: Add your code here
    TOUT(1, 1, printf("jump kernel [%s]\n", param));
    return 0;
}
